import {defineStore} from "pinia";
import {ref} from "vue";

export const useComponentManageStore = defineStore('componentManage', () => {
    let componentDataList = ref([]);
    let componentSearchData = ref({});
    let updateDialogVisible = ref(false);
    let deleteDialogVisible = ref(false);

    function resetComponentDataList(info) {
        componentDataList.value = info;
    }

    function resetComponentSearchData(info) {
        componentSearchData.value = info;
    }

    function resetUpdateDialogVisible(flag) {
        updateDialogVisible.value = flag;
    }

    function resetDeleteDialogVisible(flag) {
        deleteDialogVisible.value = flag;
    }

    return { componentDataList, resetComponentDataList, componentSearchData, resetComponentSearchData, updateDialogVisible, resetUpdateDialogVisible,
        deleteDialogVisible, resetDeleteDialogVisible }
})